package text00.tx02.demo01;


public class InstanCreator<T> {

    private Class<T> clazz;

    public InstanCreator(Class<T> clazz) {
        this.clazz = clazz;
    }

    public T newInstance() {
        try {
            return clazz.getConstructor().newInstance();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
